import React from 'react';
import {createStackNavigator} from '@react-navigation/stack';
import LoginStore from '@/stores/loginStore';
import AppIntro from '../screens/AppIntro';
import Login from '../screens/Login';

const Stack = createStackNavigator();

function LoginStack(props) {
  const loginStore = LoginStore.useStore();
  const initialRoute = loginStore.firstLogin
    ? AppIntro.routeName
    : Login.routeName;
  return (
    <Stack.Navigator headerMode="none" initialRouteName={initialRoute}>
      <Stack.Screen name={AppIntro.routeName} component={AppIntro} />
      <Stack.Screen name={Login.routeName} component={Login} />
    </Stack.Navigator>
  );
}

LoginStack.routeName = 'LoginStack';
export default LoginStack;
